<?php /* Smarty version 2.6.14, created on 2015-03-25 14:29:47
         compiled from gamepaychannel.index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'gamepaychannel.index.html', 39, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<form action="<?php echo $this->_tpl_vars['formAction']; ?>
" method="POST" <?php if ($this->_tpl_vars['is_validator']): ?> id="adminform" onsubmit="return Validator.Validate(this)" <?php endif; ?>>
<link rel="stylesheet" type="text/css" href="<?php echo @BASEURI; ?>
public/css/ui.datepicker.css"/>
<script language="javascript" src="<?php echo @BASEURI; ?>
public/js/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo @BASEURI; ?>
public/css/jquery.autocomplete.css"/>
<style type="text/css">
    table div{
        float:left;
        margin:3px auto 6px auto;
        padding:0px;
    }
    #search tr{
        line-height:120%;
        margin:0px;
        padding:0px;
    }

    select{
        height:23px;
    }
</style>
<script language="javascript" src="<?php echo @BASEURI; ?>
public/js/ui.datetimepicker.js"></script>

<table border="0" class="search" cellspacing="0" id="search">
    <tr>
        <td class="searchlogo"></td>
        <td>
            充值游戏:
            <input type="text" name="country" id="selectGame" value="<?php echo $this->_tpl_vars['games'][$this->_tpl_vars['gameId']]; ?>
" />
            <input type="text" name="gameId" id="gamess" value="<?php echo $this->_tpl_vars['gameId']; ?>
" style="display: none"/>
            <!--游戏服务区:
            <select name="s[server_id]" id="server" style="width:150px">
                <option value='' >-请选择-</option>
            </select>-->
            统计日期:<input class="text" style="width:150px" type="text" name="date" id="cdate_s"  value="<?php echo $this->_tpl_vars['date']; ?>
"/>
            选择渠道:
            <select name="channelId" id="s_channel">
                <option value=''>--选择渠道--</option>
                <?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['channel'],'selected' => $this->_tpl_vars['channelId']), $this);?>

            </select>&nbsp;&nbsp;
            <input type="button" class="button" name="ng" onclick="selectData()" id="disbut" value="查看" />
            <input type="button" id="setmiao" style="display: none" value ="10" />
        </td>
    </tr>
    <!--<tr>
    	<td>&nbsp;</td><th><p><?php echo $this->_tpl_vars['platformName']; ?>
</p></th>
    </tr>-->
</table>
<table width="100%" border="0" class="adminlist" cellspacing="0">
    <thead>
        <tr>
            <th>游戏名称</th>
            <th>总新增用户</th>
            <th>新增用户</th>
            <th>平台老用户</th>
            <th>新增设备</th>
            <th>充值人数</th>
            <th>充值金额</th>
        </tr>
    </thead>
    <tbody id="showInfo">
        <tr>
            <td><span style="color:#f86300">全部</span></td>
            <td><span style="color:#f86300"><?php echo $this->_tpl_vars['sum']['addUserTot']+$this->_tpl_vars['sum']['oldUserTot']; ?>
</span></td>
            <td><span style="color:#f86300"><?php echo $this->_tpl_vars['sum']['addUserTot']; ?>
</span></td>
            <td><span style="color:#f86300"><?php echo $this->_tpl_vars['sum']['oldUserTot']; ?>
</span></td>
            <td><span style="color:#f86300"><?php echo $this->_tpl_vars['sum']['adddeviceTot']; ?>
</span></td>
            <td><span style="color:#f86300"><?php echo $this->_tpl_vars['sum']['count']; ?>
</span></td>
            <td><span style="color:#f86300"><?php echo $this->_tpl_vars['sum']['sum']; ?>
</span></td>
        </tr>
    <?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['info']):
?>
    <tr class="row0">
        <td><a href="/datasummary/show/game_id/<?php echo $this->_tpl_vars['key']; ?>
"><?php echo $this->_tpl_vars['games'][$this->_tpl_vars['key']]; ?>
</a></td>
        <td><?php echo $this->_tpl_vars['info']['addUser']+$this->_tpl_vars['info']['addUser']; ?>
</td>
        <td><?php echo $this->_tpl_vars['info']['addUser']; ?>
</td>
        <td><?php echo $this->_tpl_vars['info']['oldUser']; ?>
</td>
        <td><?php echo $this->_tpl_vars['info']['addDevice']; ?>
</td>
        <td><?php echo $this->_tpl_vars['info']['payUser']; ?>
</td>
        <td><?php echo $this->_tpl_vars['info']['payTotle']; ?>
&nbsp;</td>
    </tr>
    <?php endforeach; endif; unset($_from); ?>

    </tbody>

    <tfoot>
    <tr>
        <td colspan="9"></td>
    </tr>
    </tfoot>

</table>
</form>

<script language="javascript">

    $("#selectGame").autocomplete("/game_manager/search",{
        max: 10,//显示数据条数
        minChars:1, //在触发autoComplete前用户至少需要输入的字符数 默认为0 在输入框内双击或者删除输入框内内容时显示列表
        matchCase:false,
        matchContains:true,
        //matchContains: "word",//只要包含输入字符就会显示提示
        autoFill:false,//自动填充输入框
        scroll:false,//不显示滚动条
        parse: function(data){
            var rows = [];
            var d = eval(data);
            for(var i=0; i<d.length; i++){
                rows[rows.length] = {
                    data:d[i], //每条数据对象
                    value:d[i].name, //与输入的值比较的数据
                    result:d[i].name  //选中的实际数据
                };
            }
            return rows;
        },
        formatItem: function(row, i, max) {
            console.log(row);
            return   "<span class='ac_name'>"+row.name + "</span>";
        },
        formatMatch: function(row, i, max) {
            return row.name + " " + row.game_id;
        },
        formatResult: function(row) {
            return row.name;
        }
    }).result(function(event, row, formatted) {
        $("#gamess").val(row.game_id);
    });

    $('#cdate_s').datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"",maxDate:"0"});


    window.onload = setdis;

    function setdis()
    {
        var miao = $('#setmiao').val();

        $("#disbut").val('稍等 '+miao+'秒');
        $("#disbut").attr("disabled",true);
        var setMiao = parseInt(miao) - 1;
        $('#setmiao').val(setMiao);
        if(miao == 0 ) {
            $("#disbut").attr("disabled",false);
            $("#disbut").val('查询');
            return;
        }
        setTimeout("setdis()", 1000);
    }

    function selectData() {
        submitform('<?php echo @BASEURI; ?>
gamepaychannel/index', false);
    }

</script>

<?php echo $this->_tpl_vars['line']; ?>